
log using comparisons, replace

use "BES2019_W19_Panel_SubsetVariables.dta"



xtset id wave


/* Dependent Variables:

Internal Efficacy: efficacyunderstand
External Efficacy: efficacypolcare
Trust in MPs: trustmps
Satisfaction with UK democracy: satdemuk
Civic Duty to Vote: rec_dutytovote2
*/



/*******Section 1: Intraclass correlations approach*******/

/**error: no individual observed in all waves
icc rec_dutytovote2 id wave if inlist(wave, 1, 2, 3, 4, 6, 7, 8, 12, 14, 15, 17, 18 ), mixed absolute
*/

icc efficacyunderstand id wave if inlist(wave, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 15, 16, 17 ), mixed absolute
icc trustmps id wave if inlist(wave, 1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 15, 16, 17, 18, 19 ), mixed absolute
icc satdemuk id wave if inlist(wave, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 13, 15, 16, 17, 19 ), mixed absolute
icc efficacypolcare id wave if inlist(wave, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 15, 16, 17 ), mixed absolute


/*******Section 2: AR1 approach*******/


asdoc xtregar rec_dutytovote2 ib1.rec_gender ib1.p_edlevel ib1.agecoh ib1.p_gross_household  ib1.religious ib0.partyid ib0.partyidstrength ib1.country ib1.wavefe, re nest stat(rho_ar sigma_u sigma_e rho_fov) replace save(simple_ar1.doc)

asdoc xtregar efficacyunderstand ib1.rec_gender ib1.p_edlevel ib1.agecoh ib1.p_gross_household  ib1.religious ib0.partyid ib0.partyidstrength ib1.country ib1.wavefe, re nest stat(rho_ar sigma_u sigma_e rho_fov) append


asdoc xtregar trustmps ib1.rec_gender ib1.p_edlevel ib1.agecoh ib1.p_gross_household  ib1.religious ib0.partyid ib0.partyidstrength ib1.country ib1.wavefe, re nest stat(rho_ar sigma_u sigma_e rho_fov) append
 


asdoc xtregar satdemuk ib1.rec_gender ib1.p_edlevel ib1.agecoh ib1.p_gross_household  ib1.religious ib0.partyid ib0.partyidstrength ib1.country ib1.wavefe, re nest stat(rho_ar sigma_u sigma_e rho_fov) append



asdoc xtregar efficacypolcare ib1.rec_gender ib1.p_edlevel ib1.agecoh ib1.p_gross_household  ib1.religious ib0.partyid ib0.partyidstrength ib1.country ib1.wavefe, re nest stat(rho_ar sigma_u sigma_e rho_fov) append





/*******Section 3: Arellano-Bond linear dynamic panel-data estimation approach*******/




char rec_gender[omit] 1
char p_edlevel[omit] 1
char agecoh[omit] 1
char p_gross_household[omit] 1
char religious[omit] 0
char partyid[omit] 0
char partyidstrength[omit] 0
char country[omit] 1

eststo: xi:  xtabond rec_dutytovote2 i.rec_gender i.p_edlevel i.agecoh i.p_gross_household  i.religious i.partyid i.partyidstrength i.country i.wave, lags(1)
estimates store dutydynamic 


eststo: xi:  xtabond efficacyunderstand i.rec_gender i.p_edlevel i.agecoh i.p_gross_household  i.religious i.partyid i.partyidstrength i.country i.wave, lags(1)  
estimates store inteffdynamic 

eststo: xi:  xtabond trustmps i.rec_gender i.p_edlevel i.agecoh i.p_gross_household  i.religious i.partyid i.partyidstrength i.country i.wave, lags(1)  
estimates store trustdynamic

eststo: xi: xtabond satdemuk i.rec_gender i.p_edlevel i.agecoh i.p_gross_household  i.religious i.partyid i.partyidstrength i.country i.wave, lags(1)  
estimates store satdemdynamic

eststo: xi: xtabond efficacypolcare i.rec_gender i.p_edlevel i.agecoh i.p_gross_household  i.religious i.partyid i.partyidstrength i.country i.wave, lags(1)  
estimates store outeffdynamic

esttab dutydynamic  inteffdynamic trustdynamic satdemdynamic outeffdynamic using simpledynamic.doc, replace se star(* 0.10 ** 0.05)




/*******Section 4: Rolling correlation*******/

keep id wave efficacypolcare efficacyunderstand satdemuk trustmps rec_dutytovote2

reshape wide rec_dutytovote2 trustmps satdemuk efficacyunderstand efficacypolcare, i(id) j(wave)

save "BES_1to19_correlations.dta", replace

asdoc pwcorr rec_dutytovote21 rec_dutytovote22 rec_dutytovote23 rec_dutytovote24 rec_dutytovote25 rec_dutytovote26 rec_dutytovote27 rec_dutytovote28 rec_dutytovote29 rec_dutytovote210 rec_dutytovote211 rec_dutytovote212 rec_dutytovote213 rec_dutytovote214 rec_dutytovote215 rec_dutytovote216 rec_dutytovote217 rec_dutytovote218 rec_dutytovote219, replace save(dutycorr.doc)



asdoc pwcorr efficacyunderstand1 efficacyunderstand2 efficacyunderstand3 efficacyunderstand4 efficacyunderstand5 efficacyunderstand6 efficacyunderstand7 efficacyunderstand8 efficacyunderstand9 efficacyunderstand10 efficacyunderstand11 efficacyunderstand12 efficacyunderstand13 efficacyunderstand14 efficacyunderstand15 efficacyunderstand16 efficacyunderstand17 efficacyunderstand18 efficacyunderstand19, replace save(inteffcorr.doc)


asdoc pwcorr trustmps1 trustmps2 trustmps3 trustmps4 trustmps5 trustmps6 trustmps7 trustmps8 trustmps9 trustmps10 trustmps11 trustmps12 trustmps13 trustmps14 trustmps15 trustmps16 trustmps17 trustmps18 trustmps19, replace save(trustcorr.doc)

asdoc pwcorr satdemuk1 satdemuk2 satdemuk3 satdemuk4 satdemuk5 satdemuk6 satdemuk7 satdemuk8 satdemuk9 satdemuk10 satdemuk11 satdemuk12 satdemuk13 satdemuk14 satdemuk15 satdemuk16 satdemuk17 satdemuk18 satdemuk19, replace save(satdemukcorr.doc)

asdoc pwcorr efficacypolcare1 efficacypolcare2 efficacypolcare3 efficacypolcare4 efficacypolcare5 efficacypolcare6 efficacypolcare7 efficacypolcare8 efficacypolcare9 efficacypolcare10 efficacypolcare11 efficacypolcare12 efficacypolcare13 efficacypolcare14 efficacypolcare15 efficacypolcare16 efficacypolcare17 efficacypolcare18 efficacypolcare19, replace save(exteffcorr.doc)

log close
translate comparisons.smcl comparisons.pdf

